package cc.bukkitPlugin.banitem.manager;

import org.bukkit.command.CommandSender;

import cc.bukkitPlugin.banitem.BanItem;
import cc.bukkitPlugin.util.plugin.ABukkitPlugin;
import cc.bukkitPlugin.util.plugin.fileManager.TLangManager;

public class LangManager extends TLangManager<BanItem>{

    public LangManager(BanItem pPlugin){
        super(pPlugin,"lang.yml","1.0");
    }

    @Override
    public boolean reloadConfig(CommandSender pSender){
        if(!super.reloadConfig(pSender)){
            ABukkitPlugin.warn(pSender,C("MsgErrorHappendWhenReloadLang"));
            return false;
        }
        this.checkUpdate();
        this.addDefaults();
        boolean result=this.saveConfig(null);
        ABukkitPlugin.info(pSender,C("MsgLangReloaded"));
        return result;
    }

    @Override
    protected void addDefaults(){
        super.addDefaults();
        this.mConfig.addDefault("MsgThisItemIsBaned","&c该物品已被封禁");
        this.mConfig.addDefault("MsgThisItemIsBanedUseFlag","&c该物品已被限制使用权限");
        this.mConfig.addDefault("MsgThisBlockIsBaned","&c该方块已被封禁,禁止交互");
        this.mConfig.addDefault("MsgYouShouldHoldItemInHand","&c你的手上应该拿着东西");
        this.mConfig.addDefault("MsgAlreadyAddItemToBanList","已经添加物品%item%到封禁列表");
    }

}
